{* 导航栏拥有二级时的样式  *}
<div class="sidebar">
  <ul class="sidenav">
    {$admin_menu = Config::get('admin_menu')}
    {foreach $sidebar_menu_list as $k=>$v}
    <li class="js_topMenu"><a href="javascript:void(0);">{*<i class="n-icon {$admin_menu.$k}"></i>*}{$v.title}<em></em></a>
      <ul class="sidenav2" style="display:none;">
      {if $v.children}
      {foreach $v.children as $key => $value}
        {if $controller == 'index'}
          {$_action = $action}
        {elseif $action == 'index'}
          {$_action = $controller}
        {else}
          {$_action = sprintf("%s/%s", $controller, $action)}
        {/if}
        <li data="{$action}|{$_action}|{$value.action}"{if $module == $value.module && $_action == $value.action} class="curr"{/if}>
          <a href="{AnUrl("{if $value.module}{$value.module}/{/if}admin{if $value.action}/{$value.action}{/if}")}">{$value.title}</a>
        </li>
      {/foreach}
      {/if}
      </ul>
    </li>
    {/foreach}
  </ul>
</div>
<script>
$(function(){
  $('.js_topMenu').click(function(e){
    var s=e.target || e.srcElement;
    if ($(s).parents(".sidenav2").size()>0) {
      return;
    }

    $(this).siblings().removeClass('curr')
    $(this).siblings().find('ul:visible').slideUp();
    if (!$(this).find('ul:visible').length) {
      $(this).find('ul').slideDown();
      $(this).addClass('curr');
    } else {
      $(this).find('ul').slideUp();
      $(this).removeClass('curr');
    }
  });

  $(".sidenav2 li").each(function(i, n){
    if ($(this).hasClass('curr')) {
      $(this).closest('ul').show();
      $(this).closest('.js_topMenu').addClass('curr');
    };
  });
});
</script>